﻿@using WsdShop.Model
@{
    Layout = "";
}

<div class="w_myCash" ng-controller="BalanceDetailController">
    <div class="w_mybalance_top">
        <img src="@ViewBag.Avatar" class="w_mybaltop_flag" />
        <div class="w_mybaltop_con">
            <div>我的余额</div>
            <p>￥{{Amount}}</p>
        </div>
    </div>
    <div class="w_mybaltop_ti" ng-click="$state.go('user.recharge')"><a><span>充值</span></a></div>
    <div class="w_excrecord_ti">余额明细</div>
    <div class="w_excrecord_main w_mybal_main">

            <div class="w_myCash_per" ng-repeat="item in List">
                <div class="w_myCash_left">
                    <div>{{item.Note}}</div>
                    <p>{{item.AddTime}}</p>
                </div>
                <div class="w_myCash_right">{{item.Amount>0?'+':''}}{{item.Amount}}</div>
           </div>

    </div>


</div>
<script>
    App.controller('BalanceDetailController', [
            '$scope', '$state', '$route', '$rootScope', '$http', '$filter',
                function ($scope, $state, $route, $rootScope, $http, $filter) {
                    $scope.Amount = 0;
                    $scope.List = [];
                    layer.load(2);
                    $http.post("/UserCenter/GetBalanceDetail").then(function (response) {
                        layer.closeAll('loading');
                        if (response.data.isSuccess) {
                            $scope.List = angular.copy(response.data.data);
                            $scope.Amount = angular.copy(response.data.data1);
                        }

                    });
                    var tt = function () {
                        $rootScope.WxShare($rootScope.pageTitle(), '优品三悦', location.href, $rootScope.LogoUrl);
                    }

                    setTimeout(tt, 1000)
                }
    ]);
</script>